package com.aceitunaproject.server.initializer;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import com.aceitunaproject.server.AceitunaContext;
import com.aceitunaproject.server.installation.InstallationType;
import com.aceitunaproject.server.materialgoods.GoodProduction;
import com.aceitunaproject.server.terrain.TerrainType;
import com.aceitunaproject.server.terrain.TerrainTypeImpl;
import com.aceitunaproject.server.terrain.TerrainTypeLoader;

/**
 * 
 * Small TerrainTypeLoader for testing purposes
 * 
 * @author Federico Bergstein
 *
 */
public class TestTerrainTypeLoader implements TerrainTypeLoader {

	/* (non-Javadoc)
	 * @see com.aceitunaproject.server.terrain.TerrainTypeLoader#getTerrainTypes()
	 */
	@Override
	public Map<String, TerrainType> getTerrainTypes() {

		Map<String, TerrainType> map = new HashMap<String, TerrainType>();
		List<InstallationType> def = new LinkedList<InstallationType>();
		def.add(AceitunaContext.getInstallationTypeManager().getAllInstallationTypes().get("DefaultInstallationType"));
		List<GoodProduction> gpList = new LinkedList<GoodProduction>();
		GoodProduction gp = new GoodProduction();
		gp.setMaterialGood(AceitunaContext.getMaterialGoodsManager().getAllMaterialGoods().get("Food"));
		gp.setTicksPerBlock(20);
		gpList.add(gp);
		map.put("Grassland", new TerrainTypeImpl("Grassland", gpList, def, null,null,true));
		map.put("Plains", new TerrainTypeImpl("Plains", null, null, def,null,false));
		
		return map;
	}

}
